<!doctype html>
<html >
<head>
    <meta charset="UTF-8">
    <title>用户的密码修改</title>
    <!-- 引入 layui.css -->
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
    <META content="MSHTML 6.00.2900.5626" name=GENERATOR></HEAD>
</head>
<script  type="text/javascript">
    /**
     * 最终提交修改
     */
    function updaback3(){
        //第一步判断原来的密码是否正确
        var oldpassword=$("#oldpassword").val();
        $.get('/supplier/oldpassword', {'oldpassword':oldpassword },function (res) {
            //第一步的判断如果密码正确的话
            if(res>0){
                var password1=$("#password1").val();
                var password2=$("#password2").val();
                if(password1!=password2){
                    layer.msg('温馨提示，两次密码输入不正确')
                }
                else if(password1==null||password1==""){
                    layer.msg('温馨提示，新密码不能为空')
                }else{

                    if(confirm("确定修改吗")){
                        var password=$("#password1").val();

                        $.get('/supplier/updatePwdOK', {'password':password },function (res) {
                            if(res>0){
                                layer.msg('提示，修改成功')
                                location.href="/supplier/update_Login_Password.html"
                            }
                            else{
                                layer.msg('温馨提示，修改失败')
                            }
                        })

                    }

                }

            }
            //第一步如果密码错误的话
            else{
                // alert("原密码错误");
                layer.msg('温馨提示，原密码错误')

            }
        })










    }
</script>
<BODY>
<form name=form action="jiffprov_hysave.asp" method="post">
    <table class="layui-table lay-even  lay-skin='line' lay-size='lg' "  >
        <tr bgColor=#ffffff>
            <td align=middle width="100%" bgColor=#ffffff colSpan=20 height=22>
                <H2>
                    <b color=#0070c0>供应商密码修改</b>
                </H2>
            </td>
        </tr>
        <tr>

            <td  class=t1 noWrap width="11%" >登&nbsp;录&nbsp;名</td>
            <td  class=t2 noWrap >[[${employee.user.loginId}]]</td>
            <td class=t1 noWrap width="11%">登录密码</td>
            <td class=t2 noWrap width="35%">
                <input type="password"  id="oldpassword" name="oldpassword" placeholder="请再输入您原来的密码" autocomplete="off" class="layui-input">
            </td>
        </tr>
        <tr>
            <td class=t1 nowrap width="11%">更改密码</td>
            <td class=t2 noWrap width="28%">
                <input type="password" placeholder="请输入您要修改的密码"  name="password1" id="password1" autocomplete="off" class="layui-input">
            </td>
            <td class=t1 noWrap width="11%">确认密码</td>
            <td class=t2 noWrap width="35%">
                <input type="password" placeholder="请再输入一遍密码" name="password2"  id="password2"  autocomplete="off" class="layui-input">
            </td>
        </tr>
        <tr>
            <td class=t1 nowrap width="11%">用户姓名</td>
            <td class=t2 noWrap width="28%" id="id" name="id">[[${employee.empName}]]</td>
            <td class=t1 noWrap width="11%">性别</td>
            <td class=t2 noWrap width="35%">[[${employee.sex}]]</td>
        </tr>
        <tr >
            <td class=t1 noWrap width="11%">联系电话</td>
            <td class=t2 noWrap width="28%">[[${employee.phone}]]</td>
            <td class=t1 noWrap width="11%">传&nbsp;&nbsp;&nbsp;&nbsp;真</td>
            <td class=t2 noWrap width="35%">[[${employee.fax}]]</td>
        </tr>
        <tr>
            <td class=t1 noWrap width="11%">电子邮箱</td>
            <td class=t2 noWrap width="28%">[[${employee.email}]]</td>
            <td class=t1 noWrap width="11%"> 邮&nbsp;&nbsp;&nbsp;&nbsp;编</td>
            <td class=t2 noWrap width="35%">[[${employee.zip}]]</td>
        </tr>
        <tr >
            <td class=t1 noWrap width="11%">联系地址</td>
            <td class=t2 noWrap colspan=3>[[${employee.address}]]</td></tr>
    </table>

    <P align=center>
        <INPUT id=button1 name=button1 type=button value="修改" onclick="updaback3()"	class="layui-btn" >
    </P>
</form>
</BODY>
</html>